﻿using Events;

const int threshold = 30_000;
var emailPriceChangeNotifier = new EmailPriceChangeNotifier(threshold);
var pushPriceChangeNotifier = new PushPriceChangeNotifier(threshold);
var goldPriceReader = new GoldPriceReader();
goldPriceReader.AttachObserver(emailPriceChangeNotifier);
goldPriceReader.AttachObserver(pushPriceChangeNotifier);

goldPriceReader.PriceRead += emailPriceChangeNotifier.Update;
goldPriceReader.PriceRead += pushPriceChangeNotifier.Update;

for (int i = 0; i < 3; i++)
{
    goldPriceReader.ReadCurrentPrice();
}



Console.ReadKey();

public delegate void PriceRead(decimal price);
